package com.shop2cn.iapi.shenqisettlement.parameter;

import java.util.Arrays;
import java.util.List;

import com.shop2cn.iapi.shenqisettlement.parameter.bean.ProxyFissionCommissionBean;
import com.ymt.base.BaseBean;
import com.ymttest.utils.TestDataManager;

@SuppressWarnings("serial")
public class SaveProxyFissionConfigReq extends BaseBean{

	/**
	 * 商户 id
	 */
	private Long merchantId;
	
	/**
	 * 返佣设置数组(至少一个对象)
	 */
	private List<ProxyFissionCommissionBean> commissions;
	
	/**
	 * 分佣基数 1:（建议零售价-商品代理价）*返佣比例  2:商品代理价*返佣比例
	 */
	private Integer baseCommissionType;
	
	/**
	 * 结算时间： （0代表立即发货后立即结算）
	 */
	private Integer proxyFissionSettlementDelayDays;
	
	/**
	 * 邀请代理门槛
	 */
	private String inviteProxyLimit;
	
	/**
	 * 返佣门槛
	 */
	private String commissionLimit;

	public Long getMerchantId() {
		return merchantId;
	}

	public void setMerchantId(Long merchantId) {
		this.merchantId = merchantId;
	}

	public List<ProxyFissionCommissionBean> getCommissions() {
		return commissions;
	}

	public void setCommissions(List<ProxyFissionCommissionBean> commissions) {
		this.commissions = commissions;
	}

	public Integer getBaseCommissionType() {
		return baseCommissionType;
	}

	public void setBaseCommissionType(Integer baseCommissionType) {
		this.baseCommissionType = baseCommissionType;
	}

	public Integer getProxyFissionSettlementDelayDays() {
		return proxyFissionSettlementDelayDays;
	}

	public void setProxyFissionSettlementDelayDays(
			Integer proxyFissionSettlementDelayDays) {
		this.proxyFissionSettlementDelayDays = proxyFissionSettlementDelayDays;
	}

	public String getInviteProxyLimit() {
		return inviteProxyLimit;
	}

	public void setInviteProxyLimit(String inviteProxyLimit) {
		this.inviteProxyLimit = inviteProxyLimit;
	}
	
	public String getCommissionLimit() {
		return commissionLimit;
	}

	public void setCommissionLimit(String commissionLimit) {
		this.commissionLimit = commissionLimit;
	}

	public static SaveProxyFissionConfigReq buildStandardSaveProxyFissionConfigReq(Long merchantId) {
		
		SaveProxyFissionConfigReq saveProxyFissionConfigReq = new SaveProxyFissionConfigReq();
		
		ProxyFissionCommissionBean proxyFissionCommissionBean = new ProxyFissionCommissionBean();
		
		proxyFissionCommissionBean.setProxyLevelLabel(TestDataManager.randomStr(7));
		proxyFissionCommissionBean.setProxyLevelIndex(1310323);
		proxyFissionCommissionBean.setLayer1Rate("0.21");
		proxyFissionCommissionBean.setLayer2Rate("0.12");

		saveProxyFissionConfigReq.setMerchantId(merchantId);
		saveProxyFissionConfigReq.setCommissions(Arrays.asList(proxyFissionCommissionBean));
		saveProxyFissionConfigReq.setInviteProxyLimit("2000.00");
		saveProxyFissionConfigReq.setCommissionLimit("0.00");
		saveProxyFissionConfigReq.setProxyFissionSettlementDelayDays(0);
		saveProxyFissionConfigReq.setBaseCommissionType(2);
		
		return saveProxyFissionConfigReq;
	}
	
	public SaveProxyFissionConfigReq withProxyFissionSettlementDelayDays(int proxyFissionSettlementDelayDays) {
		
		this.setProxyFissionSettlementDelayDays(proxyFissionSettlementDelayDays);
		
		return this;
	}
	
	public SaveProxyFissionConfigReq withBaseCommissionType(int baseCommissionType) {
		
		this.setBaseCommissionType(baseCommissionType);
		
		return this;
	}
	
	public SaveProxyFissionConfigReq withCommissionLimit(String commissionLimit) {
		
		this.setCommissionLimit(commissionLimit);
		
		return this;
	}
}
